﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _9.DeleteAllOddLines
{
    class DeleteAllOddLines
    {
        static void Main(string[] args)
        {

            StreamReader reader = new StreamReader(@"..\..\DeleteAllOddLines.cs");
            StringBuilder result = new StringBuilder();
            using (reader)
            {
                int lineNum = 0;
                result.Append("Result: \r\n");
                while (reader.EndOfStream != true)
                {
                    string line = reader.ReadLine();
                    lineNum++;
                    if (lineNum % 2 == 0)
                    {
                        result.Append(line);
                        result.Append("\r\n");
                    }
                }
            }
            StreamWriter writer = new StreamWriter(@"..\..\Result.txt", true);
            using (writer)
            {
                writer.WriteLine();
                writer.WriteLine(result.ToString());
            }
        }
    }
}
